<script setup>
import ShopPriceScrollView from "@/views/home/components/ShopPriceScrollView.vue";
import { ref } from "vue";
import { useRoute, useRouter } from "vue-router";

// 路由页面之间的传值，接收
const route = useRoute();
const router = useRouter();
// 是否为推荐品牌界面
const hidetabbar = route.query.hidetabbar;
console.log(hidetabbar);
if (hidetabbar == "1") {
  route.meta.hidetabbar = true;
}

const nodata = ref(true);
const onBackHome = () => {
  router.push({ path: "/home" });
};
</script>
<template>
  <!-- nav -->
  <div class="nav">
    <span>购物车</span>
  </div>
  <!-- 购物车没有数据 -->
  <div class="no-data" v-if="nodata">
    <span class="no-data-text">您的购物车没有数据</span>
    <span @click="onBackHome" class="no-data-btn">继续看看</span>
  </div>
  <div class="title">
    <div>- 热卖单品 -</div>
  </div>

  <ShopPriceScrollView class="recommend-price" />

  <div class="title">
    <div>- 主推单品 -</div>
  </div>

  <ShopPriceScrollView class="recommend-price" />
</template>

<style lang="scss" scoped>
.nav {
  height: 90px;
  width: 100%;
  display: flex;
  background-color: #fff;
  align-items: flex-end;
  border-bottom: 1px solid #999;
  span {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 18px;
    color: #333;
    padding-bottom: 5px;
  }
}

.no-data {
  width: 100%;
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;

  .no-data-text {
    color: #666;
    font-size: 20px;
    margin-top: 40px;
  }

  .no-data-btn {
    margin-top: 20px;
    background-color: #fff;
    font-size: 14px;
    color: #666;
    border: 1px solid #666;
    padding: 3px 10px;
    //border-radius: 3px;
  }
}

.title {
  display: block;
  height: 40px;
  text-align: center;
  font-size: 18px;
  line-height: 22px;
  color: #333;
}

.recommend-price {
  height: 120px;
}
</style>
